<ul class="pstgms lstli" id="newGame"></ul>
<!-- Declare a JsRender template, in a script block: -->
<script id="gameTmpl" type="text/x-jsrender">
  {{for}}
      <li>
          <article class="pstcnt bgco1 rnd5">
            <figure class="rnd5">
              <a href="game.html?id={{:Id}}"
                ><img
                  src="{{:cover}}"
                  data-src="{{:cover}}"
                  width="60"
                  height="60"
                  class="widgetimage"
                  alt="{{:name}}"
                /><noscript
                  ><img
                    src="/images/defaultimg.png"
                    data-src="{{:cover}}"
                    width="60"
                    height="60"
                    class="widgetimage"
                    alt="{{:name}}" /></noscript
                ></a>
            </figure>
            <header>
              <h2><a href="game.html?id={{:Id}}" class="thumb_link" rel="bookmark" title="{{:name}}">{{:name}}</a></h2>
              <a class="iconb-game" href="game.html?id={{:Id}}" title="Play {{:name}}"><span>Play</span></a>
            </header>
          </article>
        </li>
    {{/for}}
</script>

<script>
  $.ajax({
    url: "https://app.nocodb.com/api/v2/tables/mg01furv08tboqh/records?viewId=vwkcjs6aeek51qs1&limit=6&shuffle=1&offset=0&where=(tag,anyof,New)",
    type: "GET",
    dataType: "json",
    headers: {
      "xc-token": "dePwLQ88UMbt4O9ndpBSQ-6RUC_nIhhpPea_0kTR",
    },
    contentType: "application/json; charset=utf-8",
    success: function (gameData) {
      // item Template
      let gameTmpl = $.templates("#gameTmpl");

      let gameHtml = gameTmpl.render(gameData.list.splice(0, 8));
      $("#newGame").html(gameHtml);
    },
    error: function (error) {
      console.error(error);
    },
  });
</script>
